

*********************************************************************
*Purpose: Run all analyses in paper and supporting information (SI)**
*Stata Version: 17
*By Marc van de Wardt (m.p.vande.wardt@vu.nl)
*********************************************************************

**Install additional packages needed

ssc install blindschemes, replace
net install blindschemes_fix, replace from("http://digital.cgdev.org/doc/stata/MO/Misc")
ssc install estout, replace

**Set working directory

cd "C:\Users\LT-054912\surfdrive\Diffusion\dataverse files\"

**Open log file

log using "Stata commands to replicate all analyses.smcl", replace

********************************
**Figure 2, Table 1 & Table A3**
********************************

use "dataset for analysis.dta", clear
**do-file in which spatial lags are created is available from Marc van de Wardt 

************
**Figure 2**
************

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
sum wy_lag_ln_totentry2_ipol if e(sample)==1, d
margins, at(wy_lag_ln_totentry2_ipol=(`r(min)'(0.1)`r(max)')) l(95) 
matrix y_=r(table)'
svmat y_

range g 0 13.1 132
			 
foreach v of varlist y_1-g {
	rename `v' `v'_e
}

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
sum wx_lag_votperforentrants2_ipol if e(sample)==1
margins, at(wx_lag_votperforentrants2_ipol=(`r(min)'(0.1)`r(max)')) l(95) 
matrix y_=r(table)'
svmat y_

range g 0 58.4 585

foreach v of varlist y_1-g {
	rename `v' `v'_f
}

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
sum wx_lag_density_ipol if e(sample)==1, d
margins, at(wx_lag_density_ipol=(`r(min)'(1)`r(max)')) l(95) 
matrix y_=r(table)'
svmat y_

range g 0 89 90

foreach v of varlist y_1-g {
	rename `v' `v'_g
}

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
sum wx_lag_votperfor_ipol if e(sample)==1

margins, at(wx_lag_votperfor_ipol=(`r(min)'(10)`r(max)')) l(95) 
matrix y_=r(table)'
svmat y_

range g 0 570 58

foreach v of varlist y_1-g {
	rename `v' `v'_i
}

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year

gen yline=0

gen where=-0.09
gen pipe = "|"

graph twoway hist wy_lag_ln_totentry2_ipol if e(sample)==1, percent color(white) yaxis(2) ///
		||   scatter where wy_lag_ln_totentry2_ipol, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off) ///
	    ||   line y_1_e g_e, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1) ///
        ||   line y_5_e g_e, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line  y_6_e g_e, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line yline g_e, clwidth(thin) clcolor(red) clpattern(dash) ///
	    ||   , ///
             xlabel(0(1)13.1, nogrid labsize(3)) ///
		     ylabel(-0.1(0.1)0.4, nogrid axis(1) labsize(3)) ///
		     ylabel(0(20)80, nogrid axis(2) labsize(3)) ///
	         yscale(noline alt) ///
		     yscale(noline alt axis(2))	 ///
             xscale(noline) ///
             legend(off) ///
             xtitle("Wy: Entry party family abroad", size(3)) ///
             ytitle("Number of new party family members (ln)", axis(1) size(3)) ///
             ytitle("% of observations", axis(2) size(3)) ///
             xsca(titlegap(2)) ///
             ysca(titlegap(2)) ///
			 scheme(plottig) name(a, replace)

graph twoway hist wx_lag_votperforentrants2_ipol if e(sample)==1, percent color(white) yaxis(2) ///
		||   scatter where  wx_lag_votperforentrants2_ipol, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off) ///
	    ||   line y_1_f g_f, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1) ///
        ||   line y_5_f g_f, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line  y_6_f g_f, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line yline g_f, clwidth(thin) clcolor(red) clpattern(dash) ///
	    ||   , ///
             xlabel(0(5)58.4, nogrid labsize(3)) ///
		     ylabel(-0.1(0.1)0.4, nogrid axis(1) labsize(3)) ///
		     ylabel(0(20)80, nogrid axis(2) labsize(3)) ///
	         yscale(noline alt) ///
		     yscale(noline alt axis(2))	 ///
             xscale(noline) ///
             legend(off) ///
             xtitle("Wx: Vote share new party family members abroad", size(3)) ///
             ytitle("Number of new party family members (ln)", axis(1) size(3)) ///
             ytitle("% of observations", axis(2) size(3)) ///
             xsca(titlegap(2)) ///
             ysca(titlegap(2)) ///
			 scheme(plottig) name(b, replace)
 
reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year

drop where
gen where=-0.095

graph twoway hist wx_lag_density_ipol if e(sample)==1, percent color(white) yaxis(2) ///
		||   scatter where wx_lag_density_ipol, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off) ///
	    ||   line y_1_g g_g, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1) ///
        ||   line y_5_g g_g, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line  y_6_g g_g, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line yline g_g, clwidth(thin) clcolor(red) clpattern(dash) ///
	    ||   , ///
             xlabel(0(5)89, nogrid labsize(3)) ///
		     ylabel(-0.1(0.1)0.4, nogrid axis(1) labsize(3)) ///
		     ylabel(0(20)80, nogrid axis(2) labsize(3)) ///
	         yscale(noline alt) ///
		     yscale(noline alt axis(2))	///
             xscale(noline) ///
             legend(off) ///
             xtitle("Wx: Density party family abroad" , size(3)) ///
             ytitle("Number of new party family members (ln)" , axis(1) size(3)) ///
             ytitle("% of observations", axis(2) size(3)) ///
             xsca(titlegap(2)) ///
             ysca(titlegap(2)) ///
			 scheme(plottig) name(c, replace)
			 
drop where
gen where=-0.09

graph twoway hist wx_lag_votperfor_ipol if e(sample)==1, percent color(white) yaxis(2) ///
		||   scatter where  wx_lag_votperfor_ipol, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off) ///
	    ||   line y_1_i g_i, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1) ///
        ||   line y_5_i g_i, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line  y_6_i g_i, clpattern(dash) clwidth(thin) clcolor(black) ///
        ||   line yline g_i, clwidth(thin) clcolor(red) clpattern(dash) ///
	    ||   , ///
             xlabel(0(50)570, nogrid labsize(3)) ///
		     ylabel(-0.1(0.1)0.4, nogrid axis(1) labsize(3)) ///
		     ylabel(0(20)80, nogrid axis(2) labsize(3)) ///
	         yscale(noline alt) ///
		     yscale(noline alt axis(2))	 ///
             xscale(noline) ///
             legend(off) ///
             xtitle("Wx: Vote share party family abroad", size(3)  ) ///
             ytitle("Number of new party family members (ln)", axis(1) size(3)) ///
             ytitle("% of observations", axis(2) size(3)) ///
             xsca(titlegap(2)) ///
             ysca(titlegap(2)) ///
			 scheme(plottig) name(d, replace)
			 
graph combine a b c d, altshrink scheme(plottig) 
graph export "Figure2.tif", replace

****************
**Table 1 & A3**
****************

use "dataset for analysis.dta", clear

/*These are the regression coefficients depicted in Table 1 (without controls) in the manuscript and Table A3 in the SI (full model) on which Figure 2 of the manuscript is based and Figure A1 of the SI*/

**Broad definition of entry

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod1

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

reg ln_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod3

reg ln_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod4

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod5

**Now we save the data needed to calculate short and long run effects reported in Figure A1

gen b=_b[wy_lag_ln_totentry2] in 1
gen se=_se[wy_lag_ln_totentry2] in 1
gen ldv=_b[lag_ln_totentry2_ipol] in 1
gen ldvse=_se[lag_ln_totentry2_ipol] in 1
gen avneigh=15 in 1

replace b=_b[wx_lag_votperforentrants] in 2
replace se=_se[wx_lag_votperforentrants] in 2
replace ldv=_b[lag_ln_totentry2_ipol] in 2
replace ldvse=_se[lag_ln_totentry2_ipol] in 2
replace avneigh=15 in 2

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename wx_lag_votperforentrants2_ipol wx_lag_votperforentrants2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b

**Narrow definition of entry

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol wy_lag_ln_totentry2_ipol 
rename wx_lag_votperforentrants3_ipol wx_lag_votperforentrants2_ipol
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod6

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod7

reg ln_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod8

reg ln_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod9

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod10

replace b=_b[wy_lag_ln_totentry2] in 3
replace se=_se[wy_lag_ln_totentry2] in 3
replace ldv=_b[lag_ln_totentry2_ipol] in 3
replace ldvse=_se[lag_ln_totentry2_ipol] in 3
replace avneigh=15 in 3

replace b=_b[wx_lag_votperforentrants2] in 4
replace se=_se[wx_lag_votperforentrants2] in 4
replace ldv=_b[lag_ln_totentry2_ipol] in 4
replace ldvse=_se[lag_ln_totentry2_ipol] in 4
replace avneigh=15 in 4

**Table 1 without controls

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "Table1.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table 1. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems, 1961-2016) order(wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) legend label collabels(none) varlabels(_cons Constant) replace

**Table A3 with controls 

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA3.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A3. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems, 1961-2016 – With controls) order(wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

*************
**Figure A1**
*************

gen shortrun=b*avneigh
gen longrun=shortrun/(1-ldv)
gen ubshort=shortrun+(1.96*se*avneigh)
gen lbshort=shortrun-(1.96*se*avneigh)

gen ubshort2=shortrun+(1.96*se)
gen lbshort2=shortrun-(1.96*se)
gen ldvub=ldv+(1.96*ldvse)
gen ldvlb=ldv-(1.96*ldvse)

gen ublong=ubshort2/(1-ldvub)
gen lblong=lbshort2/(1-ldvlb)

drop ubshort2 lbshort2 ldvub ldvlb

**H1
gen effect=shortrun[1] in 1
replace effect=longrun[1] in 2

gen lb=lbshort[1] in 1
replace lb=lblong[1] in 2

gen ub=ubshort[1] in 1
replace ub=ublong[1] in 2

**H2
replace effect=shortrun[2] in 3
replace effect=longrun[2] in 4

replace lb=lbshort[2] in 3
replace lb=lblong[2] in 4

replace ub=ubshort[2] in 3
replace ub=ublong[2] in 4

preserve

gen vertical=_n
drop if vertical>4
replace vertical=5-vertical

label def vertical 4 "short-run Wy: Entry party family abroad" 3 "long-run Wy: Entry party family abroad" 2 "short-run Wx: Vote share new party family members abroad" 1 "long-run Wx: Vote share new party family members abroad"
label values vertical vertical

twoway (scatter vertical effect, msymbol(smcircle) mcolor(black)) ///
(rcap lb ub vertical, lcolor(black) horizontal), ///
ytitle(, size(medsmall) color(white)) xline(0, lpattern(dash) lcolor(red)) ///
ylabel(4(1)1, angle(0) valuelabel labsize(small)) xtitle(Spatial Effects , size(3)) xlabel(, labsize(3)) legend(off) scheme(plottig) aspectratio(1) name(c, replace)
graph export "figureA1.tif", replace

*************
**Figure A2**
*************

use "dataset for analysis.dta", clear

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
margins, dydx(wx_lag_density_ipol) at(wx_lag_density_ipol=(0(1)89)) l(95)
matrix y_=r(table)'
svmat y_

gen ldv=_b[lag_ln_totentry2_ipol]
gen ldvse=_se[lag_ln_totentry2_ipol]
gen avneigh=15
gen se=y_2

gen shortrun=y_1*avneigh
gen longrun=shortrun/(1-ldv)
gen ubshort=shortrun+(1.96*se*avneigh)
gen lbshort=shortrun-(1.96*se*avneigh)

gen ubshort2=shortrun+(1.96*se)
gen lbshort2=shortrun-(1.96*se)
gen ldvub=ldv+(1.96*ldvse)
gen ldvlb=ldv-(1.96*ldvse)

gen ublong=ubshort2/(1-ldvub)
gen lblong=lbshort2/(1-ldvlb)

drop ubshort2 lbshort2 ldvub ldvlb

range g 0 89 90

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year

gen yline=0
gen pipe = "|"

capture drop where
gen where=-0.098

twoway hist wx_lag_density_ipol if e(sample)==1, percent bcolor(white) yaxis(2) ///
|| scatter where wx_lag_density_ipol, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) ///
|| line ubshort g, lcolor(black) lpattern(dash dash) yaxis(1) ///
|| line lbshort g, lcolor(black) lpattern(dash dash) ///
|| line shortrun g, lcolor(black) lpattern(solid) ///
|| line ublong g, lcolor(gs10) lpattern(dash dash) ///
|| line lblong g, lcolor(gs10) lpattern(dash dash) ///
|| line longrun g, lcolor(gs10) lpattern(solid) ///
|| line yline g, lcolor(red) lpattern(dash) ///
|| , ///
xlabel(0(10)90, nogrid labsize(medium) angle(45)) ///
ylabel(-0.1(0.05)0.1, nogrid axis(1) labsize(medium)) ///
ylabel(0(20)80, nogrid axis(2) labsize(medium)) ///
yscale(noline alt) ///
yscale(noline alt axis(2))	 ///
xscale(noline) ///
xtitle("Wx: Density party family abroad", size(medium) ) ///
ytitle("Short and long-run spatial effect", axis(1) size(medium)) ///
ytitle("% of observations", axis(2) size(medium)) ///
xsca(titlegap(2)) ///
ysca(titlegap(2)) ///
legend(order(4 "Short-run effect" 7 "Long-run effect") size(medium) pos(6)) ///
scheme(plottig) name(a, replace)

use "dataset for analysis.dta", clear

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
margins, dydx(wx_lag_votperfor_ipol) at(wx_lag_votperfor_ipol=(0(10)579)) l(95)

matrix y_=r(table)'
svmat y_

gen ldv=_b[lag_ln_totentry2_ipol]
gen ldvse=_se[lag_ln_totentry2_ipol]
gen avneigh=15
gen se=y_2

gen shortrun=y_1*avneigh
gen longrun=shortrun/(1-ldv)
gen ubshort=shortrun+(1.96*se*avneigh)
gen lbshort=shortrun-(1.96*se*avneigh)

gen ubshort2=shortrun+(1.96*se)
gen lbshort2=shortrun-(1.96*se)
gen ldvub=ldv+(1.96*ldvse)
gen ldvlb=ldv-(1.96*ldvse)

gen ublong=ubshort2/(1-ldvub)
gen lblong=lbshort2/(1-ldvlb)

drop ubshort2 lbshort2 ldvub ldvlb

range g 0 579 58

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year

gen yline=0
gen pipe = "|"

capture drop where
gen where=-0.0195

graph twoway hist wx_lag_votperfor_ipol if e(sample)==1, percent color(white) yaxis(2) ///
		|| scatter where wx_lag_votperfor_ipol, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) ///
	    || line ubshort g, lcolor(black) lpattern(dash dash) yaxis(1) ///
		|| line lbshort g, lcolor(black) lpattern(dash dash) ///
		|| line shortrun g, lcolor(black) lpattern(solid) ///
		|| line ublong g, lcolor(gs10) lpattern(dash dash) ///
		|| line lblong g, lcolor(gs10) lpattern(dash dash) ///
		|| line longrun g, lcolor(gs10) lpattern(solid) ///
		|| line yline g, lcolor(red) lpattern(dash) ///
	  || , ///
xlabel(0(50)570, nogrid labsize(medium) angle(45)) ///
ylabel(-0.02(0.01)0.02, nogrid axis(1) labsize(medium)) ///
ylabel(0(20)80, nogrid axis(2) labsize(medium)) ///
yscale(noline alt) ///
yscale(noline alt axis(2))	 ///
xscale(noline) ///
xtitle("Wx: Vote share party family abroad", size(medium)) ///
ytitle("Short and long-run spatial effect", axis(1) size(medium)) ///
ytitle("% of observations", axis(2) size(medium)) ///
xsca(titlegap(2)) ///
ysca(titlegap(2)) ///
legend(order(4 "Short-run effect" 7 "Long-run effect") size(medium) pos(6)) ///
scheme(plottig) name(b, replace)
			 		 
grc1leg a b, legendfrom(a) scheme(plottig) 
graph export "figureA2.tif", replace

***************************
**Figure 3 & Table A5, A6**
***************************

use "dataset for analysis.dta", clear

/*These are the regression coefficients depicted in Table A5 & A6 (SI) on which Figure 3 of the manuscript is based*/

**Broad definition of entry

//Block-26

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr2 lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod1

gen b=_b[ wy_lag_ln_totentry2_agr2] in 2
gen se=_se[ wy_lag_ln_totentry2_agr2] in 2
gen ldv=_b[lag_ln_totentry2_ipol] in 2
gen ldvse=_se[lag_ln_totentry2_ipol] in 2
gen avneigh=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr2 wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod2

gen b2=_b[wy_lag_ln_totentry2_agr2] in 2
gen se2=_se[wy_lag_ln_totentry2_agr2] in 2
gen ldv2=_b[lag_ln_totentry2_ipol] in 2
gen ldvse2=_se[lag_ln_totentry2_ipol] in 2
gen avneigh2=15 in 2

replace b2=_b[wy_lag_ln_totentry2_ipol] in 1
replace se2=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv2=_b[lag_ln_totentry2_ipol] in 1
replace ldvse2=_se[lag_ln_totentry2_ipol] in 1
replace avneigh2=15 in 1

//Block-CMP

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod5

gen b5=_b[wy_lag_ln_totentry2_cmp] in 2
gen se5=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv5=_b[lag_ln_totentry2_ipol] in 2
gen ldvse5=_se[lag_ln_totentry2_ipol] in 2
gen avneigh5=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp wy_lag_ln_totentry2_ipol  lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod6

gen b6=_b[wy_lag_ln_totentry2_cmp] in 2
gen se6=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv6=_b[lag_ln_totentry2_ipol] in 2
gen ldvse6=_se[lag_ln_totentry2_ipol] in 2
gen avneigh6=15 in 2

replace b6=_b[wy_lag_ln_totentry2_ipol] in 1
replace se6=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv6=_b[lag_ln_totentry2_ipol] in 1
replace ldvse6=_se[lag_ln_totentry2_ipol] in 1
replace avneigh6=15 in 1

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp_nosi lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod9

gen b9=_b[wy_lag_ln_totentry2_cmp] in 2
gen se9=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv9=_b[lag_ln_totentry2_ipol] in 2
gen ldvse9=_se[lag_ln_totentry2_ipol] in 2
gen avneigh9=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp_nosi wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod10

gen b10=_b[wy_lag_ln_totentry2_cmp] in 2
gen se10=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv10=_b[lag_ln_totentry2_ipol] in 2
gen ldvse10=_se[lag_ln_totentry2_ipol] in 2
gen avneigh10=15 in 2

replace b10=_b[wy_lag_ln_totentry2_ipol] in 1
replace se10=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv10=_b[lag_ln_totentry2_ipol] in 1
replace ldvse10=_se[lag_ln_totentry2_ipol] in 1
replace avneigh10=15 in 1

//Block-4

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr4 lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod13

gen b13=_b[wy_lag_ln_totentry2_agr4] in 2
gen se13=_se[wy_lag_ln_totentry2_agr4] in 2
gen ldv13=_b[lag_ln_totentry2_ipol] in 2
gen ldvse13=_se[lag_ln_totentry2_ipol] in 2
gen avneigh13=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr4 wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod14

gen b14=_b[wy_lag_ln_totentry2_agr4] in 2
gen se14=_se[wy_lag_ln_totentry2_agr4] in 2
gen ldv14=_b[lag_ln_totentry2_ipol] in 2
gen ldvse14=_se[lag_ln_totentry2_ipol] in 2
gen avneigh14=15 in 2

replace b14=_b[wy_lag_ln_totentry2_ipol] in 1
replace se14=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv14=_b[lag_ln_totentry2_ipol] in 1
replace ldvse14=_se[lag_ln_totentry2_ipol] in 1
replace avneigh14=15 in 1

//All foreign parties

reg ln_totentry2_ipol wx_lag_ln_elecentry2_ipol2 lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod17

gen b17=_b[wx_lag_ln_elecentry2_ipol2] in 2
gen se17=_se[wx_lag_ln_elecentry2_ipol2] in 2
gen ldv17=_b[lag_ln_totentry2_ipol] in 2
gen ldvse17=_se[lag_ln_totentry2_ipol] in 2
gen avneigh17=15 in 2

reg ln_totentry2_ipol wx_lag_ln_elecentry2_ipol2 wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod18

gen b18=_b[wx_lag_ln_elecentry2_ipol2] in 2
gen se18=_se[wx_lag_ln_elecentry2_ipol2] in 2
gen ldv18=_b[lag_ln_totentry2_ipol] in 2
gen ldvse18=_se[lag_ln_totentry2_ipol] in 2
gen avneigh18=15 in 2

replace b18=_b[wy_lag_ln_totentry2_ipol] in 1
replace se18=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv18=_b[lag_ln_totentry2_ipol] in 1
replace ldvse18=_se[lag_ln_totentry2_ipol] in 1
replace avneigh18=15 in 1

**Narrow definition of entry

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_agr2 wy_lag_ln_totentry2_agr2_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_cmp wy_lag_ln_totentry2_cmp_b
rename wy_lag_ln_totentry2_agr4 wy_lag_ln_totentry2_agr4_b
rename wx_lag_ln_elecentry2_ipol2 wx_lag_ln_elecentry2_ipol2_b
rename wy_lag_ln_totentry2_cmp_nosi wy_lag_ln_totentry2_cmp_nosi_b

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol wy_lag_ln_totentry2_ipol
rename wy_lag_ln_totentry3_agr2 wy_lag_ln_totentry2_agr2
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol
rename wy_lag_ln_totentry3_cmp wy_lag_ln_totentry2_cmp
rename wy_lag_ln_totentry3_agr4 wy_lag_ln_totentry2_agr4
rename wx_lag_ln_elecentry3_ipol2 wx_lag_ln_elecentry2_ipol2
rename wy_lag_ln_totentry3_cmp_nosi wy_lag_ln_totentry2_cmp_nosi

//Block-26

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr2 lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod3

gen b3=_b[wy_lag_ln_totentry2_agr2] in 2
gen se3=_se[wy_lag_ln_totentry2_agr2] in 2
gen ldv3=_b[lag_ln_totentry2_ipol] in 2
gen ldvse3=_se[lag_ln_totentry2_ipol] in 2
gen avneigh3=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr2 wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod4

gen b4=_b[wy_lag_ln_totentry2_agr2] in 2
gen se4=_se[wy_lag_ln_totentry2_agr2] in 2
gen ldv4=_b[lag_ln_totentry2_ipol] in 2
gen ldvse4=_se[lag_ln_totentry2_ipol] in 2
gen avneigh4=15 in 2

replace b4=_b[wy_lag_ln_totentry2_ipol] in 1
replace se4=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv4=_b[lag_ln_totentry2_ipol] in 1
replace ldvse4=_se[lag_ln_totentry2_ipol] in 1
replace avneigh4=15 in 1

//Block-CMP

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod7

gen b7=_b[wy_lag_ln_totentry2_cmp] in 2
gen se7=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv7=_b[lag_ln_totentry2_ipol] in 2
gen ldvse7=_se[lag_ln_totentry2_ipol] in 2
gen avneigh7=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod8

gen b8=_b[wy_lag_ln_totentry2_cmp] in 2
gen se8=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv8=_b[lag_ln_totentry2_ipol] in 2
gen ldvse8=_se[lag_ln_totentry2_ipol] in 2
gen avneigh8=15 in 2

replace b8=_b[wy_lag_ln_totentry2_ipol] in 1
replace se8=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv8=_b[lag_ln_totentry2_ipol] in 1
replace ldvse8=_se[lag_ln_totentry2_ipol] in 1
replace avneigh8=15 in 1

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp_nosi lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod11

gen b11=_b[wy_lag_ln_totentry2_cmp] in 2
gen se11=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv11=_b[lag_ln_totentry2_ipol] in 2
gen ldvse11=_se[lag_ln_totentry2_ipol] in 2
gen avneigh11=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_cmp_nosi wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod12

gen b12=_b[wy_lag_ln_totentry2_cmp] in 2
gen se12=_se[wy_lag_ln_totentry2_cmp] in 2
gen ldv12=_b[lag_ln_totentry2_ipol] in 2
gen ldvse12=_se[lag_ln_totentry2_ipol] in 2
gen avneigh12=15 in 2

replace b12=_b[wy_lag_ln_totentry2_ipol] in 1
replace se12=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv12=_b[lag_ln_totentry2_ipol] in 1
replace ldvse12=_se[lag_ln_totentry2_ipol] in 1
replace avneigh12=15 in 1

//Block-4

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr4 lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod15

gen b15=_b[wy_lag_ln_totentry2_agr4] in 2
gen se15=_se[wy_lag_ln_totentry2_agr4] in 2
gen ldv15=_b[lag_ln_totentry2_ipol] in 2
gen ldvse15=_se[lag_ln_totentry2_ipol] in 2
gen avneigh15=15 in 2

reg ln_totentry2_ipol wy_lag_ln_totentry2_agr4 wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod16

gen b16=_b[wy_lag_ln_totentry2_agr4] in 2
gen se16=_se[wy_lag_ln_totentry2_agr4] in 2
gen ldv16=_b[lag_ln_totentry2_ipol] in 2
gen ldvse16=_se[lag_ln_totentry2_ipol] in 2
gen avneigh16=15 in 2

replace b16=_b[wy_lag_ln_totentry2_ipol] in 1
replace se16=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv16=_b[lag_ln_totentry2_ipol] in 1
replace ldvse16=_se[lag_ln_totentry2_ipol] in 1
replace avneigh16=15 in 1

//All foreign parties

reg ln_totentry2_ipol wx_lag_ln_elecentry2_ipol2 lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod19

gen b19=_b[wx_lag_ln_elecentry2_ipol2] in 2
gen se19=_se[wx_lag_ln_elecentry2_ipol2] in 2
gen ldv19=_b[lag_ln_totentry2_ipol] in 2
gen ldvse19=_se[lag_ln_totentry2_ipol] in 2
gen avneigh19=15 in 2

reg ln_totentry2_ipol wx_lag_ln_elecentry2_ipol2 wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod20

gen b20=_b[wx_lag_ln_elecentry2_ipol2] in 2
gen se20=_se[wx_lag_ln_elecentry2_ipol2] in 2
gen ldv20=_b[lag_ln_totentry2_ipol] in 2
gen ldvse20=_se[lag_ln_totentry2_ipol] in 2
gen avneigh20=15 in 2

replace b20=_b[wy_lag_ln_totentry2_ipol] in 1
replace se20=_se[wy_lag_ln_totentry2_ipol] in 1
replace ldv20=_b[lag_ln_totentry2_ipol] in 1
replace ldvse20=_se[lag_ln_totentry2_ipol] in 1
replace avneigh20=15 in 1

**Short and longrun effects

rename b b1
rename se se1
rename ldv ldv1
rename ldvse ldvse1
rename avneigh avneigh1

forvalues i = 1/20 {

gen shortrun`i'=b`i'*avneigh`i'
gen longrun`i'=shortrun`i'/(1-ldv`i')
gen ubshort`i'=shortrun`i'+(1.96*se`i'*avneigh`i')
gen lbshort`i'=shortrun`i'-(1.96*se`i'*avneigh`i')

gen ubshort2_`i'=shortrun`i'+(1.96*se`i')
gen lbshort2_`i'=shortrun`i'-(1.96*se`i')
gen ldvub_`i'=ldv`i'+(1.96*ldvse`i')
gen ldvlb_`i'=ldv`i'-(1.96*ldvse`i')

gen ublong`i'=ubshort2_`i'/(1-ldvub_`i')
gen lblong`i'=lbshort2_`i'/(1-ldvlb_`i')

drop ubshort2_`i' lbshort2_`i' ldvub_`i' ldvlb_`i'
}

esttab mod1 mod2 mod13 mod14 mod17 mod18 mod3 mod4 mod15 mod16 mod19 mod20 using "TableA5.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10" "Model 11" "Model 12") title(Table A5. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – more abstract categories) order(wy_lag_ln_totentry2_agr2 wy_lag_ln_totentry2_agr4 wx_lag_ln_elecentry2_ipol2 wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

esttab mod5 mod6 mod9 mod10 mod7 mod8 mod11 mod12 using "TableA6.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8") title(Table A6. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – CMP categories) order(wy_lag_ln_totentry2_cmp wy_lag_ln_totentry2_cmp_nosi wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

************
**Figure 3**
************

gen vertical1=_n
replace vertical1=. if vertical1>2

label def vertical1 1 "Wy: Core family (74 cat.)" 2 "Wy: Broader bloc (26 cat.)"
label values vertical1 vertical1

gen vertical2=vertical-0.1

twoway (scatter vertical1 shortrun1, msymbol(circle) mcolor(black)) (rcap lbshort1 ubshort1 vertical1, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical2 shortrun2, msymbol(circle) mcolor(gs10)) (rcap lbshort2 ubshort2 vertical2, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(a, replace)

gen vertical5=_n
replace vertical5=. if vertical5>2

label def vertical5 1 "Wy: Core family (74 cat.)" 2 "Wy: CMP (w/special issue)"
label values vertical5 vertical5

gen vertical6=vertical5-0.1

twoway (scatter vertical5 shortrun5, msymbol(circle) mcolor(black)) (rcap lbshort5 ubshort5 vertical5, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical6 shortrun6, msymbol(circle) mcolor(gs10)) (rcap lbshort6 ubshort6 vertical6, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(b, replace)

gen vertical9=_n
replace vertical9=. if vertical9>2

label def vertical9 1 "Wy: Core family (74 cat.)" 2 "Wy: CMP (wo/special issue)"
label values vertical9 vertical9

gen vertical10=vertical9-0.1

twoway (scatter vertical9 shortrun9, msymbol(circle) mcolor(black)) (rcap lbshort9 ubshort9 vertical9, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical10 shortrun10, msymbol(circle) mcolor(gs10)) (rcap lbshort10 ubshort10 vertical10, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle(Spatial effects) xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(c, replace)

gen vertical13=_n
replace vertical13=. if vertical13>2

label def vertical13 1 "Wy: Core family (74 cat.)" 2 "Wy: Broader bloc (4 cat.)"
label values vertical13 vertical13

gen vertical14=vertical13-0.1

twoway (scatter vertical13 shortrun13, msymbol(circle) mcolor(black)) (rcap lbshort13 ubshort13 vertical13, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical14 shortrun14, msymbol(circle) mcolor(gs10)) (rcap lbshort14 ubshort14 vertical14, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(d, replace)

gen vertical17=_n
replace vertical17=. if vertical17>2

label def vertical17 1 "Wy: Core family (74 cat.)" 2 "Wy: All foreign parties"
label values vertical17 vertical17

gen vertical18=vertical17-0.1

twoway (scatter vertical17 shortrun17, msymbol(circle) mcolor(black)) (rcap lbshort17 ubshort17 vertical17, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical18 shortrun18, msymbol(circle) mcolor(gs10)) (rcap lbshort18 ubshort18 vertical18, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(e, replace)

grc1leg a d e b c , xcommon rows(6) title(Broad entry definition) scheme(plottig) name(br, replace)

**Narrow definition of entry

gen vertical3=_n
replace vertical3=. if vertical3>2

label def vertical3 1 "Wy: Core family (74 cat.)" 2 "Wy: Broader bloc (26 cat.)"
label values vertical3 vertical3

gen vertical4=vertical3-0.1

twoway (scatter vertical3 shortrun3, msymbol(circle) mcolor(black)) (rcap lbshort3 ubshort3 vertical3, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical4 shortrun4, msymbol(circle) mcolor(gs10)) (rcap lbshort4 ubshort4 vertical4, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(f, replace)

gen vertical7=_n
replace vertical7=. if vertical7>2

label def vertical7 1 "Wy: Core family (74 cat.)" 2 "Wy: CMP (w/special issue)"
label values vertical7 vertical7

gen vertical8=vertical7-0.1

twoway (scatter vertical7 shortrun7, msymbol(circle) mcolor(black)) (rcap lbshort7 ubshort7 vertical7, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical8 shortrun8, msymbol(circle) mcolor(gs10)) (rcap lbshort8 ubshort8 vertical8, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(g, replace)

gen vertical11=_n
replace vertical11=. if vertical11>2

label def vertical11 1 "Wy: Core family (74 cat.)" 2 "Wy: CMP (wo/special issue)"
label values vertical11 vertical11

gen vertical12=vertical11-0.1

twoway (scatter vertical11 shortrun11, msymbol(circle) mcolor(black)) (rcap lbshort11 ubshort11 vertical11, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical12 shortrun12, msymbol(circle) mcolor(gs10)) (rcap lbshort12 ubshort12 vertical12, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("Spatial effects") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(h, replace)

gen vertical15=_n
replace vertical15=. if vertical15>2

label def vertical15 1 "Wy: Core family (74 cat.)" 2 "Wy: Broader bloc (4 cat.)"
label values vertical15 vertical15

gen vertical16=vertical15-0.1

twoway (scatter vertical15 shortrun15, msymbol(circle) mcolor(black)) (rcap lbshort15 ubshort15 vertical15, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical16 shortrun16, msymbol(circle) mcolor(gs10)) (rcap lbshort16 ubshort16 vertical16, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(i, replace)

gen vertical19=_n
replace vertical19=. if vertical19>2

label def vertical19 1 "Wy: Core family (74 cat.)" 2 "Wy: All foreign parties"
label values vertical19 vertical19

gen vertical20=vertical19-0.1

twoway (scatter vertical19 shortrun19, msymbol(circle) mcolor(black)) (rcap lbshort19 ubshort19 vertical19, ///
lpattern(solid) lcolor(black) horizontal) ///
(scatter vertical20 shortrun20, msymbol(circle) mcolor(gs10)) (rcap lbshort20 ubshort20 vertical20, ///
lpattern(solid) lcolor(gs10) horizontal) ///
, ylabel(1(1)2, angle(0) valuelabel) ///
xtitle("") xline(0, lpattern(dash) lcolor(red)) xtitle(, size(medsmall)) title("") legend(order(1 "Without Wy: Core family" 3 "With Wy: Core family")) ///
scheme(plottig) name(j, replace)

grc1leg f i j g h , xcommon rows(6) title(Narrow entry definition) scheme(plottig) name(nar, replace)

grc1leg br nar, xcommon scheme(plottig)
graph export "Figure3.tif", replace

************
**Table A2**
************

use "dataset for analysis.dta", clear

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol c.wx_lag_density_ipol##c.wx_lag_density_ipol c.wx_lag_votperfor_ipol##c.wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
keep if e(sample)==1

keep ln_totentry2_ipol ln_totentry3_ipol wy_lag_ln_totentry2_ipol wy_lag_ln_totentry3_ipol wx_lag_votperforentrants2_ipol wx_lag_votperforentrants3_ipol wx_lag_density_ipol wx_lag_votperfor_ipol lag_ln_totentry2_ipol lag_ln_totentry3_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol 

asdoc sum, save(TableA2.rtf)

************
**Table A4**
************

**Here we load a different dataset since we need balanced panels for the S-MLE estimator

use "dataset for smle.dta", clear

label var lag_ln_totentry2_ipol "Domestic party family entry t-1"
label var lag_ln_totentry3_ipol "Domestic party family entry t-1"
label var lag_VoterTurnout_ipol "Voter turnout t-1"
label var avemag_des_new_ipol "Average district magnitude t"
label var lag_RegV_ipol "Volatility by regeneration t-1"
label var lnpopnew_ipol "Population size (ln)"
label var gdpgrowth_oecd_ipol "GDP growth t"
label var diff_unemp_ipol "Change unemployment t"
label var corporatism_z_sm537_ipol "Corporatism t"
label var enep_new_ipol "ENEP t-1"
label var sig_dum_ipol "Signatures t Ref cat. No signatures required"
label var deposit_dum_ipol "Deposit t Ref cat. No deposit required"
label var funding_dum_ipol "Funding t Ref cat. No public funding available"

xtset fam_country elec_year
spset fam_country

capture spmatrix drop weight_matrix
//Here we load the weighting matrix for the generation of the spatial lags
spmatrix use weight_matrix using weight_matrix.stswm

order _ID, first

**Broad definition of entry

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_ln_totentry2_ipol) 
est store mod1
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_votperforentrants2) 
est store mod2
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_density_ipol) 
est store mod3
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_votperfor_ipol) 
est store mod4
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_ln_totentry2_ipol lag_votperforentrants2 lag_density_ipol lag_density_ipol_sq lag_votperfor_ipol lag_votperfor_ipol_sq) 
est store mod5
estat impact

**Narrow definition of entry

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b

rename ln_totentry3_ipol ln_totentry2_ipol
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_ln_totentry2_ipol) 
est store mod6
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_votperforentrants2) 
est store mod7
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_density_ipol lag_density_ipol_sq) 
est store mod8
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_votperfor_ipol lag_votperfor_ipol_sq) 
est store mod9
estat impact

spxtregress ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol, fe errorlag(weight_matrix) ivarlag(weight_matrix: lag_ln_totentry2_ipol lag_votperforentrants2 lag_density_ipol lag_density_ipol_sq lag_votperfor_ipol lag_votperfor_ipol_sq) 
estat impact
est store mod10

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA4.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A4. S-MLE models with spatially correlated errors and spatial lags, 1982-2016) order(wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) legend label collabels(none) varlabels(_cons Constant) replace

************
**Table A7**
************

use "dataset for analysis.dta", clear

**Broad definition of entry

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod1

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

reg ln_totentry2_ipol wx_lag_density_ipol_r wx_lag_density_ipol_sq_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod3

reg ln_totentry2_ipol wx_lag_votperfor_ipol_r wx_lag_votperfor_ipol_sq_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod4

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol_r wx_lag_votperforentrants2_ipol_r wx_lag_density_ipol_r wx_lag_density_ipol_sq_r wx_lag_votperfor_ipol_r wx_lag_votperfor_ipol_sq_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod5

gen b=_b[wy_lag_ln_totentry2] in 1
gen se=_se[wy_lag_ln_totentry2] in 1
gen ldv=_b[lag_ln_totentry2_ipol] in 1
gen ldvse=_se[lag_ln_totentry2_ipol] in 1
gen avneigh=15 in 1

replace b=_b[wx_lag_votperforentrants] in 2
replace se=_se[wx_lag_votperforentrants] in 2
replace ldv=_b[lag_ln_totentry2_ipol] in 2
replace ldvse=_se[lag_ln_totentry2_ipol] in 2
replace avneigh=15 in 2

**Narrow definition of entry

drop ln_totentry2_ipol wy_lag_ln_totentry2_ipol_r wx_lag_votperforentrants2_ipol_r lag_ln_totentry2_ipol

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol_r wy_lag_ln_totentry2_ipol_r 
rename wx_lag_votperforentrants3_ipol_r wx_lag_votperforentrants2_ipol_r
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod6

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod7

reg ln_totentry2_ipol wx_lag_density_ipol_r wx_lag_density_ipol_sq_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod8

reg ln_totentry2_ipol wx_lag_votperfor_ipol_r wx_lag_votperfor_ipol_sq_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod9

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol_r wx_lag_votperforentrants2_ipol_r wx_lag_density_ipol_r wx_lag_density_ipol_sq_r wx_lag_votperfor_ipol_r wx_lag_votperfor_ipol_sq_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod10

replace b=_b[wy_lag_ln_totentry2] in 3
replace se=_se[wy_lag_ln_totentry2] in 3
replace ldv=_b[lag_ln_totentry2_ipol] in 3
replace ldvse=_se[lag_ln_totentry2_ipol] in 3
replace avneigh=15 in 3

replace b=_b[wx_lag_votperforentrants2] in 4
replace se=_se[wx_lag_votperforentrants2] in 4
replace ldv=_b[lag_ln_totentry2_ipol] in 4
replace ldvse=_se[lag_ln_totentry2_ipol] in 4
replace avneigh=15 in 4

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA7.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A7. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – row standardized weighting matrix) order(wy_lag_ln_totentry2_ipol_r wx_lag_votperforentrants2_ipol_r wx_lag_density_ipol_r wx_lag_density_ipol_sq_r wx_lag_votperfor_ipol_r wx_lag_votperfor_ipol_sq_r lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

************
**Table A8**
************

use "dataset for analysis.dta", clear

**Broad definition of entry

reg ln_totentry2_ipol wy_ln_totentry2_ipol_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod1

reg ln_totentry2_ipol wx_votperforentrants2_ipol_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

reg ln_totentry2_ipol wx_density_ipol_short wx_density_ipol_sq_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod3

reg ln_totentry2_ipol wx_votperfor_ipol_short wx_votperfor_ipol_sq_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod4

reg ln_totentry2_ipol wy_ln_totentry2_ipol_short wx_votperforentrants2_ipol_short wx_density_ipol_short wx_density_ipol_sq_short wx_votperfor_ipol_short wx_votperfor_ipol_sq_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod5

drop ln_totentry2_ipol wy_ln_totentry2_ipol_short wx_votperforentrants2_ipol_short lag_ln_totentry2_ipol

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_ln_totentry3_ipol_short wy_ln_totentry2_ipol_short 
rename wx_votperforentrants3_ipol_short wx_votperforentrants2_ipol_short
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol

**Narrow definition of entry

reg ln_totentry2_ipol wy_ln_totentry2_ipol_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod6

reg ln_totentry2_ipol wx_votperforentrants2_ipol_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod7

reg ln_totentry2_ipol wx_density_ipol_short wx_density_ipol_sq_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod8

reg ln_totentry2_ipol wx_votperfor_ipol_short wx_votperfor_ipol_sq_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod9

reg ln_totentry2_ipol wy_ln_totentry2_ipol_short wx_votperforentrants2_ipol_short wx_density_ipol_short wx_density_ipol_sq_short wx_votperfor_ipol_short wx_votperfor_ipol_sq_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod10

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA8.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A8. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – Alternative temporal lag) order(wy_ln_totentry2_ipol_short wx_votperforentrants2_ipol_short wx_density_ipol_short wx_density_ipol_sq_short wx_votperfor_ipol_short wx_votperfor_ipol_sq_short lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

************
**Table A9**
************

use "dataset for analysis.dta", clear

egen fam_year=group(family_dynamic1 elec_year)

**Broad definition of entry

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod1

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod2

reg ln_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod3

reg ln_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod4

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod5

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename wx_lag_votperforentrants2_ipol wx_lag_votperforentrants2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol wy_lag_ln_totentry2_ipol 
rename wx_lag_votperforentrants3_ipol wx_lag_votperforentrants2_ipol
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol

**Narrow definition of entry

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod6

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod7

reg ln_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod8

reg ln_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod9

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year, cluster(fam_year)
est store mod10

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA9.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A9. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – Clustered standard errors) order(wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

*************
**Table A10**
*************

use "dataset for analysis.dta", clear

sort fam_country elec_year
bys fam_country: gen index=_n

gen entry_index=wy_lag_ln_totentry2_ipol*index
gen entry_index_nar=wy_lag_ln_totentry3_ipol*index

label var index "Years elapsed since first entry"
label var entry_index "Wy: Entry party family abroad * Years elapsed since first entry"
label var entry_index_nar "Wy: Entry party family abroad * Years elapsed since first entry"

**Broad definition of entry

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol index entry_index lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod1

**Narrow definition of entry

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b
rename entry_index entry_index_b

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol wy_lag_ln_totentry2_ipol 
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol
rename entry_index_nar entry_index

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol index entry_index lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

esttab mod1 mod2 using "TableA10.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2") title(Table A10. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – Interaction with time) order(wy_lag_ln_totentry2_ipol index entry_index lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace


*************
**Table A11**
*************

use "dataset for analysis.dta", clear

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename wx_lag_votperforentrants2_ipol wx_lag_votperforentrants2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b

rename ln_totentry4_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry4_ipol wy_lag_ln_totentry2_ipol 
rename wx_lag_votperforentrants4_ipol wx_lag_votperforentrants2_ipol
rename lag_ln_totentry4_ipol lag_ln_totentry2_ipol

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod1

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

reg ln_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod3

reg ln_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod4

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod5

esttab mod1 mod2 mod3 mod4 mod5 using "TableA11.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A11. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – Exclud-ing splinter parties as new) order(wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace


*************
**Table A12**
*************

use "dataset for analysis.dta", clear

**Broad definition of entry

reg ihs_totentry2_ipol wy_lag_ihs_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod1

reg ihs_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

reg ihs_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod3

reg ihs_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod4

reg ihs_totentry2_ipol wy_lag_ihs_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod5

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename wx_lag_votperforentrants2_ipol wx_lag_votperforentrants2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b
rename wy_lag_ihs_totentry2_ipol wy_lag_ihs_totentry2_ipol_b

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol wy_lag_ln_totentry2_ipol 
rename wx_lag_votperforentrants3_ipol wx_lag_votperforentrants2_ipol
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol
rename wy_lag_ihs_totentry3_ipol wy_lag_ihs_totentry2_ipol

**Narrow definition of entry

reg ihs_totentry2_ipol wy_lag_ihs_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod6

reg ihs_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod7

reg ihs_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod8

reg ihs_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod9

reg ihs_totentry2_ipol wy_lag_ihs_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod10

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA12.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A12. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – Inverse Hyperbolic Sine transfor-mation) order(wy_lag_ihs_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

*************
**Table A13**
************* 

use "dataset for analysis.dta", clear

sort fam_country elec_year

**This ensures that all in-between elections imputations are deleted
drop if elec_date==.

**Broad definition of entry

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod1

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

reg ln_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod3

reg ln_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod4

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod5

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename wx_lag_votperforentrants2_ipol wx_lag_votperforentrants2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol wy_lag_ln_totentry2_ipol 
rename wx_lag_votperforentrants3_ipol wx_lag_votperforentrants2_ipol
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol

**Narrow definition of entry

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year 
est store mod6

reg ln_totentry2_ipol wx_lag_votperforentrants2_ipol lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod7

reg ln_totentry2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod8

reg ln_totentry2_ipol wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod9

reg ln_totentry2_ipol wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod10

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA13.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8" "Model 9" "Model 10") title(Table A13. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems – No imputations) order(wy_lag_ln_totentry2_ipol wx_lag_votperforentrants2_ipol wx_lag_density_ipol wx_lag_density_ipol_sq wx_lag_votperfor_ipol wx_lag_votperfor_ipol_sq lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

*************
**Table A14**
*************

use "dataset for analysis.dta", clear

**Broad definition of entry

reg ln_totentry2_ipol neverseats wy_lag_ln_totentry2_ipol entry_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod1

reg ln_totentry2_ipol neverseats wx_lag_votperforentrants2_ipol votentry_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod2

reg ln_totentry2_ipol neverseats wx_lag_density_ipol dens_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod3

reg ln_totentry2_ipol neverseats wx_lag_votperfor_ipol vot_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod4

**Narrow definition of entry

rename ln_totentry2_ipol ln_totentry2_ipol_b
rename wy_lag_ln_totentry2_ipol wy_lag_ln_totentry2_ipol_b
rename wx_lag_votperforentrants2_ipol wx_lag_votperforentrants2_ipol_b
rename lag_ln_totentry2_ipol lag_ln_totentry2_ipol_b
rename entry_never entry_never_b
rename votentry_never votentry_never_b

rename ln_totentry3_ipol ln_totentry2_ipol
rename wy_lag_ln_totentry3_ipol wy_lag_ln_totentry2_ipol 
rename wx_lag_votperforentrants3_ipol wx_lag_votperforentrants2_ipol
rename lag_ln_totentry3_ipol lag_ln_totentry2_ipol
rename entry_never_nar entry_never
rename votentry_never_nar votentry_never

reg ln_totentry2_ipol neverseats wy_lag_ln_totentry2_ipol entry_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod5

reg ln_totentry2_ipol neverseats wx_lag_votperforentrants2_ipol votentry_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod6

reg ln_totentry2_ipol neverseats wx_lag_density_ipol dens_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod7

reg ln_totentry2_ipol neverseats wx_lag_votperfor_ipol vot_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol i.unit_fe i.elec_year
est store mod8

esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 using "TableA14.rtf", b(3) se(3) aic bic starlevels(+ 0.10 * 0.05 ** 0.01 *** 0.001) mtitles("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8") title(Table A14. S-OLS and m-STAR models explaining the logged entry rates of party families within party systems, 1961-2016) order(neverseats wy_lag_ln_totentry2_ipol entry_never wx_lag_votperforentrants2_ipol votentry_never wx_lag_density_ipol dens_never wx_lag_votperfor_ipol vot_never lag_ln_totentry2_ipol lag_VoterTurnout_ipol avemag_des_new_ipol lag_RegV_ipol lnpopnew_ipol gdpgrowth_oecd_ipol diff_unemp_ipol corporatism_z_sm537_ipol enep_new_ipol sig_dum_ipol deposit_dum_ipol funding_dum_ipol) drop(*.unit_fe *.elec_year) legend label collabels(none) varlabels(_cons Constant) replace

log close
